package javaClassExercise.ListExercise;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by lomo on 2017/3/20.
 */
public class generateRandomNumber {

    protected static List<Integer> a = new ArrayList<>();

    public static void main(String[] args) {

        //带种子,每次产出的和第一次运行产出一样
        //java.util.Random r = new java.util.Random(1);

        //不带种子，每次产出都和第一次不一样
        java.util.Random r = new java.util.Random();

        System.out.println(r.nextInt(10) + 1);

//        for (int i = 0; i<10; i++) {
//            System.out.println(r.nextInt(10) + 1);
//        }
//        for (int i = 0; i < 10; i++) {
//            System.out.println(r.nextInt());
//        }

        a.add(1);
        a.add(19);
        a.add(100);
        System.out.println("List a的容量为 ：" + a.size());
        System.out.println("取出List a中的某个value: " + a.get(1));

        String s = ".pull-left .new-pcNews>li";
        StringBuilder sb = new StringBuilder();
        sb.append(s).append(" lomo");
        System.out.println(sb); //.pull-left .new-pcNews>li lomo
    }
}
